package Demo_Old.Demo;

public enum Gender {
    男("man",2),女("woman",8);//相当于已经定义好的对象  带()的配合构造器使用(gender="man")

    private String gender;
    private int age;

     Gender(String gender,int age){
        this.gender=gender;
        this.age=age;
    }
    public void show(){
        System.out.println(gender);
        System.out.println(age);

        Gender s=valueOf("男");
        System.out.println(s.gender);

        Gender a[]=values();
        System.out.println(a[1].name());
    }
}
